const SuccessSend = (
    res,
    { code = 0, success = true, message = "获取成功", data = null }
) => {
    res.json({
        code,
        success,
        message,
        data
    });
};

const ErrorSend = (
    res,
    { code = 500, success = false, message = "获取失败", data = null }
) => {
    res.status(code).json({
        code,
        success,
        message,
        data
    });
};

module.exports = { SuccessSend, ErrorSend };
